package com.example.demo.bean;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * @ClassName MenuStream
 * @Description
 * @Author 51
 * @Date 2020年4月4日 下午4:29:42
 */
public class MenuStream {
	// 主键
	private Integer id;

	// 父节点的id
	private Integer pid;

	// 节点名称
	private String name;

	// 节点附带的URL地址，是将来点击菜单项时要跳转的地址
	private String url;

	// 节点图标的样式
	private String icon;

	// 存储子节点的集合，初始化是为了避免空指针异常|使用java8stream设置无需给定初始值
	@JsonInclude(JsonInclude.Include.NON_EMPTY) // 设置不为空的时候返回
	private List<MenuStream> children;

	// 控制节点是否默认为打开装，设置为true表示默认打开
	private Boolean open = true;

	public MenuStream() {
		// TODO Auto-generated constructor stub
	}

	public MenuStream(Integer id, Integer pid, String name, String url, String icon, List<MenuStream> children, Boolean open) {
		super();
		this.id = id;
		this.pid = pid;
		this.name = name;
		this.url = url;
		this.icon = icon;
		this.children = children;
		this.open = open;
	}

	@Override
	public String toString() {
		return "Menu [id=" + id + ", pid=" + pid + ", name=" + name + ", url=" + url + ", icon=" + icon + ", children=" + children + ", open=" + open + "]";
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getPid() {
		return pid;
	}

	public void setPid(Integer pid) {
		this.pid = pid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name == null ? null : name.trim();
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url == null ? null : url.trim();
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon == null ? null : icon.trim();
	}

	public List<MenuStream> getChildren() {
		return children;
	}

	public void setChildren(List<MenuStream> children) {
		this.children = children;
	}

	public Boolean getOpen() {
		return open;
	}

	public void setOpen(Boolean open) {
		this.open = open;
	}
}
